package com.lma.crm.classes.service.impl;

import java.util.List;

import com.lma.crm.classes.dao.CrmClassDao;
import com.lma.crm.classes.domain.CrmClass;
import com.lma.crm.classes.service.CrmClassService;

public class CrmClassServiceImpl implements CrmClassService {

    private CrmClassDao crmClassDao;
    public void setCrmClassDao(CrmClassDao crmClassDao) {
        this.crmClassDao = crmClassDao;
    }
    
    @Override
    public List<CrmClass> findAll() {
        return this.crmClassDao.findAll();
    }

    @Override
    public CrmClass findById(String classId) {
        return this.crmClassDao.findById(classId);
    }

    @Override
    public void updateUpload(CrmClass crmClass) {
        //先查詢，再更新
        CrmClass findClass = this.findById(crmClass.getClassId());
        findClass.setUploadFilename(crmClass.getUploadFilename());
        findClass.setUploadPath(crmClass.getUploadPath());
        findClass.setUploadTime(crmClass.getUploadTime());
    }
    
}
